{% extends 'base/setting_base.html' %}
{% load rest_framework %}

{% block body %}

<div class="row justify-content-md-center">
    <div class="col-8">
        <div class="card">
            <div class="card-body">
                <div class="d-md-flex align-items-center">
                    <h1 class="card-title">User Details</h1>
                </div>
                <br>
                <div class="card">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card">
                                <div class="widget-box">{% for data in user_details %}
                                    <form class="form-horizontal"
                                          action="{% url 'users:edit_user' uu_id=user_uu_id %}" method="POST">
                                        {% csrf_token %}
                                        <div class="form-group ">
                                            <label>Name</label>
                                            <input name="name" class="form-control" type="text" value="{{ data.name }}">
                                        </div>
                                        <div class="form-group ">
                                            <label>Email</label>
                                            <input name="email" class="form-control" type="text"
                                                   value="{{ data.email }}">
                                        </div>
                                        <div class="form-group ">
                                            <label>Password</label>
                                            <input name="password" class="form-control" type="password" value="{{ data.password }}"
                                                   placeholder="Password">
                                        </div>
                                        <div class="form-group ">
                                            <label>Image</label>
                                            <input name="image" class="form-control" type="text" value="{{ data.image }}"
                                                   placeholder="Image">
                                        </div>
                                        <div class="form-group ">
                                            <label>Pass token</label>
                                            <input name="pass_token" class="form-control" type="text" value="{{ data.pass_token }}"
                                                   placeholder="Pass token">
                                        </div>
                                        <div class="form-group ">
                                            <label>Organization</label>
                                            <div class="dtsb-criteria">
                                                <select class="form-control dtsb-data dtsb-dropDown"
                                                        name="organization" style="width: 100%; height:36px;">
                                                    <optgroup label="Seleted">
                                                        <option value="{{ data.organization.pk }}"
                                                                selected>{{ data.organization }}
                                                        </option>
                                                    </optgroup>
                                                    {% for data in org %}
                                                    <option value="{{ data.pk }}">{{ data.name }}</option>
                                                    {% endfor %}
                                                </select>
                                            </div>
                                        </div>

                                        <div class="form-group ">
                                            <label>Role</label>
                                            <div class="dtsb-criteria">
                                                <select class="form-control dtsb-data dtsb-dropDown" name="role"
                                                        style="width: 100%; height:36px;">
                                                    <option value="{{ data.role.pk }}" selected>{{ data.role }}</option>
                                                    <option value="1">Admin</option>
                                                    <option value="2">Analyst</option>
                                                    <option value="3">Viewer</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="border-top">
                                            <div class="card-body">
                                                <button type="submit" class="btn btn-default">Save
                                                </button>
                                            </div>
                                        </div>
                                        {% endfor %}
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}